﻿using System;
using System.Text.RegularExpressions;
using System.Windows.Data;

namespace WaitLess.App.Converters
{
    public class MunicipalOfficeNameToTitleConverter : IValueConverter
    {
        private static readonly Regex FilterRegex = new Regex("districtshuis|stadskantoor|wijkkantoor", RegexOptions.IgnoreCase);

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null || string.IsNullOrWhiteSpace(value.ToString()))
                return null;

            return FilterRegex.Replace(value.ToString(), string.Empty)
                .Trim();
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
